# lst = []
#
# for i in range(1, 15):
#     lst.append(f"python{i}")
# print(lst)


"""
列表推导式 最终给你的是列表
语法【最终结果 （变量） for 变量 in 可迭代对象】
"""

# lst = [i for i in range(1, 15)]
# print(lst)

# lst = [i for i in range(1, 15) if i % 2 == 0]
# print(lst)


# 1. 获取 1-100 内能被3整除的数

# lst = [i for i in range(1, 101) if i % 3 == 0]
# print(lst)

# 2. 100 以内能被 3 整除的数的平方

# lst = [i * i for i in range(1, 101) if i % 3 == 0]
# print(lst)

# 3. 寻找名字中带有两个e的⼈的名字
names = [['Tom', 'Billy', 'Jefferson', 'Andrew', 'Wesley', 'Steven',
          'Joe'], ['Alice', 'Jill', 'Ana', 'Wendy', 'Jennifer', 'Sherry', 'Eva']]

# for i in names:
#     for e in i:
#
#         if "e" in e:
#             print(e)

# print(i)

lst = [e for i in names for e in i if e.count("e") == 2]
print(lst)

result = [name for sublist in names for name in sublist if name.lower().count('e') == 2]

print(result)
